package zxs.sino.elite.hub.enums.user;

import zxs.sino.elite.hub.enums.BaseEnum;

/**
 * 登录类型
 *
 * @author zhang
 */
public enum LoginType implements BaseEnum<Integer> {


    WECHAT(1, "weixin"),
    PHONE(2, "mobile"),
    MAIL(3, "email");

    private final int code;
    private final String value;

    LoginType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static boolean isWechat(Integer code) {
        return BaseEnum.isType(LoginType.class, code, WECHAT);
    }

    public static boolean isPhone(Integer code) {
        return BaseEnum.isType(LoginType.class, code, PHONE);
    }

    public static boolean isMail(Integer code) {
        return BaseEnum.isType(LoginType.class, code, MAIL);
    }


}